import request from "@/utils/request";
import type { categoryListModel } from "./model/categoryModel";
/* 
    GET /admin/product/getCategory1
    GET /admin/product/getCategory2/{category1Id}
    GET /admin/product/getCategory3/{category2Id}
 */

//获取一级列表
export const getCategory1Api = () => {
  return request.get<any, categoryListModel>(`/admin/product/getCategory1`);
};
//获取二级列表
export const getCategory2Api = (category1Id: number) => {
  return request.get<any, categoryListModel>(
    `/admin/product/getCategory2/${category1Id}`
  );
};
//获取三级列表
export const getCategory3Api = (category2Id: number) => {
  return request.get<any, categoryListModel>(
    `/admin/product/getCategory3/${category2Id}`
  );
};
